<template>
  <div class="about">
    <h1>This is an about page</h1>
    <p style="margin:0;padding:0;">
      <template v-for="(text,i) in ip" :key="i">
        <span>{{text}}</span><br>
      </template>
    </p>
  </div>
</template>
<script>
export default {
  name:"About",
  data(){
    return {
      ip:[

      ]
    }
  },
  mounted(){
    this.getKeys(4870);
  },
  methods:{
    getNumber(minNum,maxNum){
      return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
    },
    getType(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,6);
        let iptext;
        switch(type){
          case 1:
            iptext="金融";
            break;
          case 2:
            iptext="政府";
            break;
          case 3:
            iptext="公共卫生";
            break;
          case 4:
            iptext="教育";
            break;
          case 5:
            iptext="通信";
            break;
          case 6:
            iptext="工业";
            break;
        }
        
        this.ip.push(iptext);
      }
    },
    getIp(count){
      for(let i = 0;i<count;i++){
        const iptext = this.getNumber(10,254)+"."+this.getNumber(10,254)+"."+this.getNumber(10,254)+"."+this.getNumber(10,254);
        this.ip.push(iptext);
      }
    },
    getBugsCount(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,100);
        let iptext;
        if(type <5){
          iptext = 0;
        }else if(type >=5 && type < 20){
          iptext = this.getNumber(1,3);
        }else if(type >=20 && type < 50){
          iptext = this.getNumber(4,8);
        }else if(type >= 50 && type <80){
          iptext = this.getNumber(9,11);
        }else if(type >= 80 && type<95){
          iptext = this.getNumber(12,15);
        }else if(type>=95){
          iptext = this.getNumber(16,25);
        }
        this.ip.push(iptext);
      }
    },
    getAddressType(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,7);
        let iptext;
        switch(type){
          case 1:
            iptext="网络产品";
            break;
          case 2:
            iptext="安全产品";
            break;
          case 3:
            iptext="物联网设备";
            break;
          case 4:
            iptext="办公外设";
            break;
          case 5:
            iptext="企业应用";
            break;
          case 6:
            iptext="系统软件";
            break;
          case 7:
            iptext="支撑系统";
            break;
        }
        
        this.ip.push(iptext);
      }
    },
    getProtocols(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,9);
        let iptext;
        if(type<=6){
          iptext="https";
        }else if( type >6 && type<=8){
          iptext="http";
        }else{
          iptext="pop3s";
        }
        this.ip.push(iptext);
      }
    },
    getSystem(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,9);
        let iptext;
        if(type<=4){
          iptext="centOs";
        }else if( type >4 && type<=6){
          iptext="ubuntu";
        }else{
          iptext="windows";
        }
        this.ip.push(iptext);
      }
    },
    getKeys(count){
      for(let i = 0;i<count;i++){
        const type = this.getNumber(1,100);
        let iptext;
        if(type<=5){
          iptext=1;
        }else{
          iptext=0;
        }
        this.ip.push(iptext);
      }
    }
  }
}
</script>






































































































